using net_work.Common.Request;
using net_work.Common.Result;
using net_work.Data.DTO.Sys;
using net_work.Data.Entity.Sys;
using net_work.Data.VO.Sys;

namespace net_work.IService.Sys;

public interface IDepartmentService
{
    /// <summary>
    /// 分页查询部门
    /// </summary>
    /// <param name="request">查询参数</param>
    /// <returns>分页结果</returns>
    Task<PagedResult<DepartmentResult>> GetDepartmentsPagedAsync(PagedRequest request);

    /// <summary>
    /// 根据部门ID查询部门信息
    /// </summary>
    /// <param name="departmentId">部门ID</param>
    /// <returns>部门信息</returns>
    Task<Department?> SelectByIdAsync(long departmentId);

    /// <summary>
    /// 插入部门
    /// </summary>
    /// <param name="departmentAddRequest">新增部门实体</param>
    /// <returns>部门ID</returns>
    Task<long> InsertDepartment(DepartmentAddRequest departmentAddRequest);

    /// <summary>
    /// 更新部门信息
    /// </summary>
    /// <param name="departmentUpdateRequest">更新部门信息</param>
    /// <returns>是否成功</returns>
    Task<int> UpdateDepartment(DepartmentUpdateRequest departmentUpdateRequest);

    /// <summary>
    /// 删除部门
    /// </summary>
    /// <param name="ids">部门ID集合</param>
    /// <returns>是否成功</returns>
    Task<int> DeleteDepartmentByIds(List<long> ids);
}